<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>vue 动画</title>
    <script src="./vue.js"></script>
   <style>
       .v-enter-active, .v-leave-active {
           transition: opacity 3s;
       }
       .v-enter, .v-leave-to {
           opacity: 0;
       }
   </style>
</head>
<body>
    <div id="app">
        <transition>
            <div v-if="show">一寸光阴一寸金</div>
        </transition>
        <button @click="btn">BTN</button>
    </div>
    <script>
        
        var vm = new Vue({
            el: '#app',
            data: {
              show: true
            },
            //方法
            methods:{
              btn: function(){
                  this.show = (this.show === true ? false : true)
              }  
            },
            //组件
            components: {
                
            },
            //计算属性
            computed:{
               
            }


        })
    </script>
</body>
</html>